<template>
<!-- StaticPart组件 -->
  <div class="position">
    <span class="iconfont position--iconfont">&#xe61f;</span>
    <span class="position__text">北京理工大学国防科技园2号楼10层</span>
    <span class="iconfont bell--iconfont">&#xe630;</span>
  </div>
  <div class="search">
    <span class="iconfont search__iconfont">&#xe631;</span>
    <input type="search" class="search__box" placeholder="请输入搜索内容" />
  </div>
  <div class="banner">
    <img
      class="banner__img"
      src="http://www.dell-lee.com/imgs/vue3/banner.jpg"
      alt=""
    />
  </div>
  <div class="icons">
    <!-- 根据导出的staticList数据的内容循环渲染组件 -->
    <div class="icons__item" v-for="(item, index) in staticList" :key="index">
      <p class="icons__item__img">
        <img :src="item.url" alt="" />
      </p>
      <p class="icons__item__tittle">{{ item.tittle }}</p>
    </div>
  </div>
  <div class="gap"></div>
</template>

<script>
export default {
  name: "StaticPart",
  setup() {
    // 设置staticList常量
    const staticList = [
      { url: "http://www.dell-lee.com/imgs/vue3/超市.png", tittle: "超市便利" },
      { url: "http://www.dell-lee.com/imgs/vue3/菜市场.png", tittle: "菜市场" },
      { url: "http://www.dell-lee.com/imgs/vue3/水果店.png", tittle: "水果店" },
      { url: "http://www.dell-lee.com/imgs/vue3/鲜花.png", tittle: "鲜花绿植" },
      {
        url: "http://www.dell-lee.com/imgs/vue3/医药健康.png",
        tittle: "医药健康",
      },
      { url: "http://www.dell-lee.com/imgs/vue3/家居.png", tittle: "家居时尚" },
      { url: "http://www.dell-lee.com/imgs/vue3/蛋糕.png", tittle: "烘焙蛋糕" },
      { url: "http://www.dell-lee.com/imgs/vue3/签到.png", tittle: "签到" },
      {
        url: "http://www.dell-lee.com/imgs/vue3/大牌免运.png",
        tittle: "大牌免运",
      },
      { url: "http://www.dell-lee.com/imgs/vue3/红包.png", tittle: "红包套餐" },
    ];
    return {
      staticList,
    };
  },
};
</script>

<style lang="scss" scoped>
@import "../../style/viriables";
@import "../../style/mixins";
.position {
  color: $content-fontcolor;
  box-sizing: border-box;
  padding: 0.16rem 0;
  width: 100%;
  height: 0.54rem;
  .position--iconfont {
    position: relative;
    top: -0.04rem;
    font-size: 0.2rem;
    margin-right: 0.1rem;
  }
  &__text {
    line-height: 0.22rem;
    font-size: 0.16rem;
    @include single-ellipsis;
    display: inline-block;
    width: 2.79rem;
  }
  .bell--iconfont {
    float: right;
    font-size: 0.2rem;
  }
}
.search {
  box-sizing: border-box;
  width: 100%;
  height: 0.32rem;
  border-radius: 0.16rem;
  background-color: $input-bgcolor;
  margin: 0 auto 0.12rem;
  padding: 0.08rem 0;
  display: flex;
  &__iconfont {
    font-size: 0.16rem;
    margin-left: 0.16rem;
    margin-right: 0.12rem;
  }
  &__box {
    flex: 1;
    height: 0.16rem;
    border: none;
    outline: none;
    background: none;
    padding: 0;
    &::-webkit-input-placeholder {
      color: #b7b7b7;
    }
  }
}
.banner {
  height: 0;
  padding-bottom: 0.86rem;
  overflow: hidden;
  &__img {
    width: 100%;
  }
}
.icons {
  width: 100%;
  padding-top: 0.16rem;
  display: flex;
  flex-wrap: wrap;
  &__item {
    width: 20%;
    margin-bottom: 0.16rem;
    &__img {
      height: 0.4rem;
      margin-bottom: 0.06rem;
      margin-top: 0;
      text-align: center;
      img {
        width: 0.4rem;
      }
    }
    &__tittle {
      margin: 0;
      font-size: 0.12rem;
      text-align: center;
      color: $content-fontcolor;
      line-height: 0.17rem;
    }
  }
}
.gap {
  background-color: $content-bgcolor;
  height: 0.1rem;
  margin: 0 -0.18rem;
}
</style>